home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / WindowMaker / wmlib / WMaker.h < prev   
Encoding:
C/C++ Source or Header  |  1999-02-17  |  3.9 KB  |  142 lines

  1. /* 
  2.  * WindowMaker interface definitions
  3.  * 
  4.  * Copyright (C) 1997 Alfredo K. Kojima
  5.  *  
  6.  *  This library is free software; you can redistribute it and/or
  7.  *  modify it under the terms of the GNU Library General Public
  8.  *  License as published by the Free Software Foundation; either
  9.  *  version 2 of the License, or (at your option) any later version.
  10.  *  
  11.  *  This library is distributed in the hope that it will be useful,
  12.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  *  Library General Public License for more details.
  15.  *  
  16.  *  You should have received a copy of the GNU Library General Public
  17.  *  License along with this library; if not, write to the Free
  18.  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  */
  20.  
  21. #ifndef _WMLIB_H_
  22. #define _WMLIB_H_
  23.  
  24. /* the definitions in this file can change at any time. WINGs has more
  25.  * stable definitions */
  26.  
  27. #include <X11/Xlib.h>
  28. #include <X11/Xmd.h>
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif /* __cplusplus */
  33.  
  34. typedef struct {
  35.     CARD32 flags;
  36.     CARD32 window_style;
  37.     CARD32 window_level;
  38.     CARD32 reserved;
  39.     Pixmap miniaturize_pixmap;           /* pixmap for miniaturize button */
  40.     Pixmap close_pixmap;           /* pixmap for close button */
  41.     Pixmap miniaturize_mask;           /* miniaturize pixmap mask */
  42.     Pixmap close_mask;               /* close pixmap mask */
  43.     CARD32 extra_flags;
  44. } GNUstepWMAttributes;
  45.  
  46. #define GSWindowStyleAttr     (1<<0)
  47. #define GSWindowLevelAttr     (1<<1)
  48. #define GSMiniaturizePixmapAttr    (1<<3)
  49. #define GSClosePixmapAttr    (1<<4)
  50. #define GSMiniaturizeMaskAttr    (1<<5)
  51. #define GSCloseMaskAttr        (1<<6)
  52. #define GSExtraFlagsAttr           (1<<7)
  53.  
  54.  
  55.  
  56. #define GSClientResizeFlag    (1<<0)
  57. #define GSFullKeyboardEventsFlag (1<<1)
  58. #define GSMenuWindowFlag    (1<<2)
  59. #define GSIconWindowFlag    (1<<3)
  60. #define GSSkipWindowListFlag    (1<<4)
  61. #define GSNoApplicationIconFlag    (1<<5)
  62. #define GSDarkGrayTitlebarFlag    (1<<8)
  63.  
  64.  
  65. #define WMFHideOtherApplications    10
  66. #define WMFHideApplication        12
  67.  
  68.  
  69. #if !defined(_NSWindow_h_) && !defined(_GNUstep_H_GUITypes)
  70. enum {
  71.   NSNormalWindowLevel   = 0,
  72.   NSFloatingWindowLevel  = 3,
  73.   NSDockWindowLevel   = 5,
  74.   NSSubmenuWindowLevel  = 10,
  75.   NSMainMenuWindowLevel  = 20
  76. };
  77.  
  78. enum {
  79.   NSBorderlessWindowMask = 0,
  80.   NSTitledWindowMask = 1,
  81.   NSClosableWindowMask = 2,
  82.   NSMiniaturizableWindowMask = 4,
  83.   NSResizableWindowMask = 8
  84. };
  85. #endif
  86.  
  87. typedef struct _wmAppContext WMAppContext;
  88.  
  89. typedef struct _wmMenu WMMenu;
  90.  
  91. typedef void (*WMMenuAction)(void *clientdata, int code, Time timestamp);
  92.  
  93. typedef void (*WMFreeFunction)(void *clientdata);
  94.  
  95. int WMProcessEvent(WMAppContext *app, XEvent *event);
  96.  
  97.  
  98. WMAppContext *WMAppCreateWithMain(Display *display, int screen_number,
  99.                   Window main_window);
  100.  
  101. WMAppContext *WMAppCreate(Display *display, int screen_number);
  102.  
  103. int WMAppAddWindow(WMAppContext *app, Window window);
  104.  
  105. int WMAppSetMainMenu(WMAppContext *app, WMMenu *menu);
  106.  
  107.  
  108. int WMRealizeMenus(WMAppContext *app);
  109.  
  110.  
  111. void WMSetWindowAttributes(Display *dpy, Window window, 
  112.                GNUstepWMAttributes *attributes);
  113.  
  114.  
  115. void WMHideApplication(WMAppContext *app);
  116. void WMHideOthers(WMAppContext *app);
  117.  
  118. /*
  119.  * WARNING: the menu related functions might be removed in the future.
  120.  */
  121. WMMenu *WMMenuCreate(WMAppContext *app, char *title);
  122.  
  123. int WMMenuAddItem(WMMenu *menu, char *text, WMMenuAction action,
  124.           void *clientData, WMFreeFunction freedata, char *rtext);
  125.  
  126. int WMMenuInsertItem(WMMenu *menu, int index, char *text, 
  127.              WMMenuAction *action, char *rtext);
  128.  
  129. int WMMenuRemoveItem(WMMenu *menu, int index);
  130.  
  131. int WMMenuAddSubmenu(WMMenu *menu, char *title, WMMenu *submenu);
  132.  
  133. void WMMenuSetEnabled(WMMenu *menu, int index, int enabled);
  134.  
  135. void WMMenuDestroy(WMMenu *menu, int submenus);
  136.  
  137. #ifdef __cplusplus
  138. }
  139. #endif /* __cplusplus */
  140.  
  141. #endif
  142.